Skip to content

HDDS-16359. Make CI survive Maven Central rate limiting - #11175

Merged
adoroszlai merged 1 commit into
apache:masterfrom
rjgoyln:HDDS-16359-maven-retry
Sep 14, 2026
Merged

adoroszlai merged 1 commit into
apache:masterfrom
rjgoyln:HDDS-16359-maven-retry

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A PR based on an older master can restore a Maven cache built from newer POMs, causing a missing dependency to be fetched from Maven Central. If Central returns HTTP 429, the job fails during dependency resolution before compilation or tests.

The existing retry settings use maven.wagon.http.*, but Maven 3.9 resolves dependencies through maven-resolver-transport-http, which uses aether.connector.http.retryHandler.*. The Wagon properties are ignored, leaving only the resolver's default of three retries (~30s), matching the 32s failure seen in the JIRA job.

This changes the settings to the resolver properties, increasing retry time to ~275s. The maximum individual wait remains 50s, below the resolver's 300s intervalMax, and existing job timeouts still bound total runtime.

maven.wagon.http.pool is removed for the same reason. http.keepAlive remains because it is JDK-level.

JIRA: https://issues.apache.org/jira/browse/HDDS-16359

Tests

Tested with Maven 3.9.16 against a repository returning HTTP 429:

MAVEN_OPTS Requests Elapsed
(none) 4 32s
maven.wagon.http.retryHandler.count=0 4 31s
aether.connector.http.retryHandler.count=0 1 4s
aether.connector.http.retryHandler.count=10 11 268s

The Wagon setting has no effect; the resolver setting works as expected.

CI jobs fail during dependency resolution, before anything is compiled,
when Maven Central answers HTTP 429. The retry settings carried in
MAVEN_OPTS since HDDS-5187 configure Wagon, which stopped being the
resolver transport when the runner image moved to Maven 3.9, so they have
had no effect for some time. Only the resolver's own default of three
retries applies, giving up after roughly 30 seconds of a rate-limit
window. Any pull request whose base predates a dependency bump on master
restores a cache that no longer holds the pinned version, so it must
fetch that artifact over the network and is exposed to this failure.
Copilot AI lite review requested due to automatic review settings August 31, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rjgoyln
rjgoyln marked this pull request as ready for review August 31, 2026 17:47

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rjgoyln +1 LGTM

@adoroszlai adoroszlai added the CI label Sep 14, 2026
@adoroszlai
adoroszlai merged commit 07fea7e into apache:master Sep 14, 2026
60 of 63 checks passed
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @rjgoyln for the patch, @chihsuan for the review.

@adoroszlai

Copy link
Copy Markdown
Contributor

@rjgoyln looks like download problem still exists, please see https://github.com/apache/ozone/actions/runs/35516534110/job/106094445653#step:13:20 for example.

@rjgoyln

rjgoyln commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out. I went through the job log, and the retry setting is taking effect, but it is not enough to overcome the sustained 429s.

The step spent 276.7s before failing. With count=10 and the default 5s interval, that matches the expected 275s of linear backoff plus request time; without the setting, it would have failed after ~32s with the default count=3.

I also found that the recurring issue is upstream of the retries: PRs that change pom.xml cannot get an exact Maven cache hit, so each job falls back to an older cache and fetches the delta from Central independently. Multiple Maven bump PRs running concurrently can amplify this.

For the retry settings, I think we overshot a bit. Sonatype recommends not retrying 429s more aggressively, and NiFi/Hudi use count=5 with connectionMaxTtl around 25–30s. We also currently have no intervalMax, so a large Retry-After could make the retry wait excessively long.

I’d suggest:

  • reduce count to 5
  • add connectionMaxTtl=25 and an intervalMax
  • remove the ineffective -Dhttp.keepAlive=false
  • address the Maven cache separately to reduce requests to Central

Ratis also adopted similar settings in RATIS-2698, so it may be worth keeping that in sync.

WDYT?

@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @rjgoyln, created HDDS-16648. Can you please also make the same change for Ratis (both ratis and ratis-thirdparty repos)?

@rjgoyln

rjgoyln commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @rjgoyln, created HDDS-16648. Can you please also make the same change for Ratis (both ratis and ratis-thirdparty repos)?

Sure, I'll make the same change for both the ratis and ratis-thirdparty repositories as well.
I've created RATIS-2725.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants